#ifndef __APP_OLED_H
#define __APP_OLED_H

#include "stm32f1xx_hal.h"
#include "stdlib.h"
#include "stdint.h"

//#include "oled_sh1106.h"
#include "oled_ssd1306.h"


#define OLED_VCC_PORT      	GPIOB
#define OLED_VCC_PIN       	GPIO_PIN_0
#define OLED_PWR_ON 				HAL_GPIO_WritePin(OLED_VCC_PORT,OLED_VCC_PIN, GPIO_PIN_RESET)
#define OLED_PWR_OFF 				HAL_GPIO_WritePin(OLED_VCC_PORT,OLED_VCC_PIN, GPIO_PIN_SET)

void OLED_HAL_Init(void);
void oled_main(void);

void oled_show1(void);
void oled_show2(void);

void oled_showText(uint8_t * text,uint8_t len);
void oled_showTime(uint8_t * text);
void oled_updatetime(void);


void oled_chanle(uint8_t menu);


typedef struct OLED_STRUCT
{
	uint8_t oled_mode;
	uint8_t oled_buff[128*8];
	uint8_t oled_update;
}OLED;

extern OLED oled;
#endif
